Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Autoupgrade attempts to update non-installed modules, causing the upgrade process to fail #1036

Conversation

Codencode
Copy link

@Codencode Codencode commented Nov 24, 2024

Added a check for the module version, ensuring that only the modules actually installed are updated.

Questions Answers
Description? When updating Prestashop using the "autoupgrade" module, the system attempts to update modules located in the "modules" folder even if they are not actually installed.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #37445
Sponsor company @Codencode
How to test? 1. Install autoupgrade module - 2. Copy the ps_mbo module into the modules folder without installing it. - 3. Perform the upgrade to the latest version of Prestashop.

Added a check for the module version, ensuring that only the modules actually installed are updated.
@Hlavtox
Copy link
Contributor

Hlavtox commented Nov 24, 2024

Hey @Codencode, I am thinking about this and I am not sure if it's the correct way to handle this.

I think that native modules that are on the disk should be updated, because they could break the module page after the upgrade. Many modules are instantiated on the module page - even if not installed.

@Codencode
Copy link
Author

Codencode commented Nov 25, 2024

Hey @Codencode, I am thinking about this and I am not sure if it's the correct way to handle this.

I think that native modules that are on the disk should be updated, because they could break the module page after the upgrade. Many modules are instantiated on the module page - even if not installed.

Hi @Hlavtox,

The check I implemented is meant to prevent the module from being updated at the database level, meaning that the scripts in the module's upgrade folder are not executed.

In practice, the module is still downloaded, and the files are updated, but if the module is not actually installed, the database update is not performed.
I believe this behavior is correct: it wouldn’t make sense to execute database operations for a module that is not truly installed.

@M0rgan01 M0rgan01 added this to the 7.0.0 milestone Nov 25, 2024
Copy link

sonarcloud bot commented Nov 25, 2024

@Codencode
Copy link
Author

The issue has been resolved in the "dev" version, so it should no longer exist in the next release.

@Codencode Codencode closed this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

Autoupgrade attempts to update non-installed modules, causing the upgrade process to fail
3 participants